Skip to content

Fix chat timeline row height estimation#1093

Open
huxcrux wants to merge 4 commits intopingdotgg:mainfrom
huxcrux:t3code/fix-chat-timeline-row-estimation
Open

Fix chat timeline row height estimation#1093
huxcrux wants to merge 4 commits intopingdotgg:mainfrom
huxcrux:t3code/fix-chat-timeline-row-estimation

Conversation

@huxcrux
Copy link
Contributor

@huxcrux huxcrux commented Mar 14, 2026

What Changed

Improved chat timeline virtualization height estimation by switching from coarse message-only estimates to row-aware estimates for user messages, assistant messages, work groups, proposed plan cards, and the working indicator.

Assistant row estimates now also account for markdown structure and changed-files summaries, while proposed plans and work groups use estimators closer to their actual rendered shape.

Fixes: #1035

This PR supersedes #1054.

Why

Some chat rows were being underestimated, which could cause overlapping content and visible scroll instability in virtualized threads.

UI Changes

Same as Why ^

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Fix chat timeline row height estimation to account for markdown, work groups, diff summaries, and proposed plans

  • Replaces estimateTimelineMessageHeight with a unified estimateTimelineRowHeight in MessagesTimeline.tsx that handles message, work, proposed-plan, and working row kinds.
  • Adds markdown-aware height estimation for assistant messages: normalizes text for wrapping, applies per-element bonuses for headings, lists, blockquotes, tables, and fenced code blocks.
  • Adds dynamic height estimation for work rows (grouped entries, overflow, file chips), diff summary sections (tree node count), and proposed plan rows (collapsible preview cap).
  • Introduces resolveMessagesTimelineRows in MessagesTimeline.logic.ts to precompute row state including completion divider flags, assistant diff summaries, and grouped work entries.
  • Adds browser-based height parity tests in MessagesTimeline.browser.tsx that mount the real component, measure DOM row heights, and assert they match estimator output within per-kind tolerances.

Macroscope summarized 28fad63.

@coderabbitai
Copy link

coderabbitai bot commented Mar 14, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 67e75fbc-afa2-4538-858a-2596f8410fcd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use oxc to improve the quality of JavaScript and TypeScript code reviews.

Add a configuration file to your project to customize how CodeRabbit runs oxc.

@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 14, 2026
@juliusmarminge
Copy link
Member

needs tests. also I think the estimation of changed files tree also need to be fixed

@github-actions github-actions bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Mar 16, 2026
@huxcrux huxcrux force-pushed the t3code/fix-chat-timeline-row-estimation branch 2 times, most recently from 308e1bb to 48a41c6 Compare March 16, 2026 21:01
@huxcrux
Copy link
Contributor Author

huxcrux commented Mar 16, 2026

needs tests. also I think the estimation of changed files tree also need to be fixed

I added tests both unit and a browser render test. Let me know in case the browser test was a bit much and i can drop it.

@CodeZeno
Copy link

needs tests. also I think the estimation of changed files tree also need to be fixed

#1113 fixes the changed files tree

@huxcrux huxcrux force-pushed the t3code/fix-chat-timeline-row-estimation branch from 48a41c6 to da366dd Compare March 22, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat timeline content overlaps (assistant text + tool call cards stack on top of each other)

3 participants